package my.dao;

import java.sql.SQLException;
import java.util.List;

import com.sun.xml.internal.ws.message.StringHeader;

import my.bean.Admin;

public interface IAdminDao {
	/**
	 * add an admin to database
	 * @param admin
	 * @return the count of object successfully insert into ADMIN	
	 */
	public int addAdmin(Admin admin) throws SQLException;

	/**
	 * delete an admin by admin's id from ADMIN 
	 * @param id
	 * @return the count of object successfully delete from ADMIN
	 */
	public int deleteAdminById(int id) throws SQLException;

	/**
	 * delete an admin by admin's account from ADMIN
	 * @param account
	 * @return the count of object successfully delete from ADMIN
	 */
	public int deleteAdminByAccount(String account) throws SQLException;

	/**
	 * modify an admin's message except password and privilege from ADMIN
	 * @param admin object
	 * @return the count of object successfully modify from ADMIN
	 */
	public int modifyBaseMessage(Admin admin) throws SQLException;

	/**
	 * only modify admin's password by admin'id from ADMIN
	 * @param id
	 * @param newPassword
	 * @return the count of object successfully modify from ADMIN
	 */
	public int modifyAdminPasswordById(int id, String newPassword) throws SQLException;

	/**
	 * only modify admin'privilege by admin'id from ADMIN
	 * @param id
	 * @param privilege
	 * @return the count of modify operation successfully
	 */
	public int modifyAdminPrivilegeById(int id, int privilege) throws SQLException;

	/**
	 * find all admin
	 * @return the list of admin
	 */
	public List<Admin> findAll();

	/**
	 * find an admin by admin'id from ADMIN
	 * @param id
	 * @return a list of admin 
	 */
	public Admin findById(int id);

	/**
	 * find the list of admin by account from ADMIN
	 * @param account
	 * @return  admin
	 */
	public Admin findByAccout(String account);
	
	/**
	 * find the admin by account and password
	 * @param account
	 * @param password
	 * @return admin
	 */
	public Admin findByAccountAndPassword(String account,String password);

}
